Skip to content

Instantly share code, notes, and snippets.

@wojteklu
wojteklu / clean_code.md
Last active May 17, 2024 12:49
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@Starefossen
Starefossen / vim-cheats.md
Last active May 17, 2024 12:47
My vim cheat sheet for working with tabs and window splits.

Tabs

New Tab

  • :tabnew - new blank tab
  • :tabedit [file] - open file in tab

Cursor Movement

  • gt (:tabn) - next tab
@alieniasty
alieniasty / Kurwa.js
Created April 8, 2019 08:49
Skrypt dodający losową kurwę
javascript:{/** * Made by kurwa Kerai * chcesz rozpowszechniac? podawaj źródło * chcesz cos zmieniac? wszystkie komentarze pisz * w komentarzach wieloliniowych, bo sie moze popsuc pod chrome i opera... */var whitespace = "-\/|.,!:;'\" \t\n\r{}[]()";var stack = [];var curNIndex = 0;var curNode = null;var curIndex = -1;var state = 1;var lastword = '';String.prototype.startsWith = function(prefix) {return this.indexOf(prefix) === 0;};String.prototype.endsWith = function(suffix) {return this.match(suffix+"$") == suffix;};/* Nie moge tak robić niestety */function kurwizeLink(url){if(url.startsWith('javascript:'))return url; /* chyba niewiele moge zrobic kurwa */if(url.startsWith('#'))return url;if(url.startsWith('http://kurwa.keraj.net/?url='))return url; /* no, bo kurwa, bez jaj ;p */var base = '';if(!url.startsWith('http')){base = location.protocol + "://" + location.host;if(!url.startsWith('/')){var pathname = location.pathname;base += pathname.substring(0, pathname.lastIndexOf('/'));}}return 'http://kurwa.kera
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 17, 2024 12:44
set -e, -u, -o, -x pipefail explanation
@jpatters
jpatters / HeidiDecode.js
Last active May 17, 2024 12:41
Decodes a password from HeidiSQL. HeidiSQL passwords can be found in the registry. Use File -> Export Settings to dump all settings. Great for if you forget a password.
function heidiDecode(hex) {
var str = '';
var shift = parseInt(hex.substr(-1));
hex = hex.substr(0, hex.length - 1);
for (var i = 0; i < hex.length; i += 2)
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);
return str;
}
document.write(heidiDecode('755A5A585C3D8141786B3C385E3A393'));
@sebsto
sebsto / gist:6af5bf3acaf25c00dd938c3bbe722cc1
Last active May 17, 2024 12:40
Start VNCServer on Mac1 EC2 Instance
# YouTube (english) : https://www.youtube.com/watch?v=FtU2_bBfSgM
# YouTube (french) : https://www.youtube.com/watch?v=VjnaVBnERDU
#
# On your laptop, connect to the Mac instance with SSH (similar to Linux instances)
#
ssh -i <your private key.pem> ec2-user@<your public ip address>
#
# On the Mac